import { createAsyncThunk } from '@reduxjs/toolkit'
import Api from '@API'
import { Platform } from 'react-native'
import { APP_NAME } from '@CONSTANTS/App'
import { getBrand, getVersion } from 'react-native-device-info'

const fetchUpdateStatue = createAsyncThunk('user/getUpdateInfoSuccess', async () => {
  const appReviewVersion = getVersion()
  const params = {
    n: APP_NAME,
    p: Platform.OS,
    v: appReviewVersion,
    b: getBrand(),
  }
  const response = await Api.checkStatus(params)
  return response
})
export default fetchUpdateStatue
